package com.bbs.event;

import com.bbs.dto.UserDTO;
import lombok.Data;
import org.springframework.context.ApplicationEvent;

import java.util.EventObject;
//登录成功事件

public class LoginSuccessEvent extends ApplicationEvent {
    //添加用户DTO字段
   private  UserDTO userDTO;
//    public abstract class ApplicationEvent extends EventObject {
//        private static final long serialVersionUID = 7099057708183571937L;
//        private final long timestamp;

    //public class EventObject implements java.io.Serializable {
    //
    //    @java.io.Serial
    //    private static final long serialVersionUID = 5516075349620653480L;
    //
    //    /**
    //     * The object on which the Event initially occurred.
    //     */
    //    protected transient Object source;
    //  默认拥有三个属性
    // private static final long serialVersionUID = 7099057708183571937L;
    ////        private final long timestamp;
    //protected transient Object source;
    //构造器，内部调用父亲构造器
    public LoginSuccessEvent(Object source,UserDTO userDTO) {
        super(source);
        this.userDTO=userDTO;
    }

    public UserDTO getUserDTO() {
        return userDTO;
    }

    public void setUserDTO(UserDTO userDTO) {
        this.userDTO = userDTO;
    }
}
